<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_Universite extends Application_Model_ModelAbstract
{

    /**
     * Database var type varchar(6)
     *
     * @var string
     */
    protected $_CUNIV;

    /**
     * Database var type varchar(120)
     *
     * @var string
     */
    protected $_LIBUNIV;



    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'CUNIV'=>'CUNIV',
            'LIBUNIV'=>'LIBUNIV',
        ));

        $this->setParentList(array(
        ));

        $this->setDependentList(array(
        ));
    }

    /**
     * Sets column CUNIV
     *
     * @param string $data
     * @return Application_Model_Universite
     */
    public function setCUNIV($data)
    {
        $this->_CUNIV = $data;
        return $this;
    }

    /**
     * Gets column CUNIV
     *
     * @return string
     */
    public function getCUNIV()
    {
        return $this->_CUNIV;
    }

    /**
     * Sets column LIBUNIV
     *
     * @param string $data
     * @return Application_Model_Universite
     */
    public function setLIBUNIV($data)
    {
        $this->_LIBUNIV = $data;
        return $this;
    }

    /**
     * Gets column LIBUNIV
     *
     * @return string
     */
    public function getLIBUNIV()
    {
        return $this->_LIBUNIV;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_Universite
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_Universite());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_Universite::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getCUNIV() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('CUNIV = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getCUNIV()));
    }
}
